<template>
  <div>
    <h1>TS</h1>
    <svg-icon icon-class="user" />
    <ul>
      <li v-for="(item, key) in newsListShow" :key="key">
        <span>{{item.fullname}} : </span>
        <span>{{item.email}}</span>
      </li>
    </ul>
    <input type="button" name="" id="" value="add" @click="setNewsApi">
  </div>
</template>

<script>
import { fetch } from '@/api/article'
export default {
  name: 'Ts',
  data() {
    return {
      newsListShow: ''
    }
  },
  methods: {
    setNewsApi: function () {
      fetch({ email: 'ds@qq.com' }).then(res => {
        console.log(res.rows)
        this.newsListShow = res.rows
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>
h1 {
  color: #ccc;
}
</style>
